;(function ()
{
    'use strict';
    angular.module('xiaohuapp',['ui.router'])
        .config([
            '$interpolateProvider',
            '$stateProvider',
            '$urlRouterProvider',
            function ($interpolateProvider,
                      $stateProvider,
                      $urlRouterProvider)
            {
                $interpolateProvider.startSymbol('[:');
                $interpolateProvider.endSymbol(':]');
                /*首页*/
                $stateProvider
                    .state('home',{
                        url:'/home',
                        templateUrl:'home.tpl'
                    });
                /*注册*/
                $stateProvider
                    .state('signup',{
                        url:'/signup',
                        templateUrl:'signup.tpl'
                    });

                $stateProvider
                    .state('login',{
                        url:'/login',
                        templateUrl:'login.tpl'
                    });
                $urlRouterProvider.otherwise('/home');
            }])

        .service('UserService',[
            function () {
                var me = this;
                me.signup = function () {
                    console.log('123456');
                }
            }])

        .controller('SignupController',[
            '$scope',
            'UserService',
            function ($scope,UserService) {
                $scope.User = UserService;
            }
        ])


})();